import redis
import time

def RedisVer(host):
    r = redis.Redis(host)
    info = r.info()
    return info['redis_version']

def ShowRedisInfo(host):
    r = redis.Redis(redis_svr)
    info = r.info()
    for key in info:
        print key, '=', info[key]
        
if __name__ == '__main__':
    redis_svr =  'localhost'
    r = redis.Redis(redis_svr)
    #r.flushall()

    for i in range(1,10):
        now = time.strftime("%Y/%m/%d %H:%M:%S")
        r.lpush('test_queue', now)
        
        print now
        time.sleep(1)
    
    

    print 'redis list show'
    while True:
        res = r.lpop('test_queue')
        if res == None:
            break
        else:
            print str(res)
            print r.llen('test_queue')
    
    print 'end'